<template>
  <div>
    <div class="audio_con">
      <audio ref='audio' :src="songUrl" @play="play" @pause="pause" controls autoplay loop class="myaudio"></audio>
    </div>
  </div>
</template>

<script>
export default {
  name: "Player",
  data() {
    return {
      isPlaying: false,
    }
  },
  computed: {
    songUrl() {
      return localStorage.getItem("songUrl");
    }
  },
  methods: {
    play() {
      this.isPlaying = true;
    },
    pause() {
      this.isPlaying = false;
    },
  },
}
</script>

<style scoped>
.audio_con {
  height: 50px;
  background-color: #f1f3f4;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.myaudio {
  width: 100%;
  height: 40px;
  margin-top: 5px;
  outline: none;
  background-color: #f1f3f4;
}
</style>